<template>
<<<<<<< HEAD
	<view class="body">
		<view style="height: 180rpx; padding-top: 200rpx; color: #FFFFFF;margin: 0 40rpx; display: flex;">
			<view>
				<view>Hi,下午好!</view>
				<view style="font-size: 45rpx; margin-top: 20rpx; font-weight: 800;">管理员</view>
			</view>
			<view style="flex: 1;"></view>
			<view style="">
				<image style="width: 120rpx; height: 120rpx; border-radius: 50%;" src="../../static/test/testFace.jpg"></image> 
			</view>
		</view>
		<view class="module-list-box">
			<view style=" padding-top: 30rpx;">
				<view style="margin-left: 30rpx;">服务事项</view>
				<view class="module" style="display: flex; flex-wrap: wrap; justify-content:space-between; margin: 0 50rpx;">
					<view @tap="toLogin" style="margin-top: 30rpx; width: 180rpx; height: 180rpx; text-align: center; background-color: #1B8FDA; box-shadow: #1B8FDA 0 2px 6px 0; border-radius: 20rpx;">
						<icon  style="color: #FFFFFF; font-size: 80rpx; margin: 20rpx 0 10rpx; " class="icon-jingqingqidai iconfont" ></icon>
						<view style="color: #FFFFFF; font-size: 28rpx;">老人注册</view>
					</view>
					<view @tap="toAll" style="margin-top: 30rpx; width: 180rpx; height: 180rpx; text-align: center; background-color: #EBA138; box-shadow: #EBA138 0 2px 6px 0; border-radius: 20rpx;">
						<icon  style="color: #FFFFFF; font-size: 80rpx; margin: 20rpx 0 10rpx; " class="icon-jiekuanshenqing iconfont" ></icon>
						<view style="color: #FFFFFF; font-size: 28rpx;">补贴代申</view>
					</view>
					<view @tap="toEmi()" style="margin-top: 30rpx; width: 180rpx; height: 180rpx; text-align: center; background-color: #00D3C4; box-shadow: #00D3C4 0 2px 6px 0; border-radius: 20rpx;">
						<icon  style="color: #FFFFFF; font-size: 80rpx; margin: 20rpx 0 10rpx; " class="icon-qianchu iconfont" ></icon>
						<view style="color: #FFFFFF; font-size: 28rpx;">迁出代申</view>
					</view>
					<view @tap="toRegistered" style="margin-top: 30rpx; width: 180rpx; height: 180rpx; text-align: center; background-color: #F18236; box-shadow: #F18236 0 2px 6px 0; border-radius: 20rpx;">
						<icon  style="color: #FFFFFF; font-size: 80rpx; margin: 20rpx 0 10rpx; " class="icon-tongji iconfont" ></icon>
						<view style="color: #FFFFFF; font-size: 28rpx;">已注册老人</view>
=======
	<view class="root" style="background-color: #FFFFFF; min-height: 100vh;">
		<view style="top: 0; z-index: 100; width: 100%; background-color: #F7FFFF; position: fixed; font-size: 45rpx; font-weight: 800;">
			<view style="height: 70rpx; "></view>
			<view style="display: flex; width: 90%;">
				<text style="display: block; margin:15rpx 37rpx;">你好，{{nickName}}!</text>
				<view style="flex: 1;"></view>

			</view>
			<view style="height: 30rpx;"></view>
		</view>

		<view v-if="sliderX == 0">
			<swiper @change="changePage" :autoplay="slideList.length > 1 ? true : false" :circular="slideList.length > 2 ? true : false" previous-margin="100rpx" next-margin="100rpx" style="width: 700rpx; height: 300rpx; margin: 50rpx auto;">
				<swiper-item v-for="(item,index) in slideList">
					<image :class="current == index ? '':'no-choice'" class="banner-img" :src="item.url"></image>
				</swiper-item>
			</swiper>

			<view class="article">
				<view style="width: 675rpx; margin: 0 auto; display: flex;">
					<text style="font-size: 30rpx; font-weight: 800;">最新资讯</text>
					<view style="flex: 1;"></view>
				</view>

				<view @tap="toDetail(item.id)" v-for="(item,index) in articleList" :key="index" style="display: flex;  width: 90%;  height: 200rpx; margin: 0rpx auto;">
					
					<view style="width: 570rpx; margin: 30rpx 0;">
						<text style="font-weight: 800;">{{ subStr(0,12,item.articleTitle,'...')}}\n</text>
						<text style="color: #888888; line-height: 30rpx; display: block; font-size: 20rpx; margin-top: 10rpx;">撰稿人：{{subStr(0,10,item.articleAuthor,'...')}}\n</text>
						<text style="color: #888888; line-height: 30rpx; display: block; font-size: 20rpx; margin-top: 10rpx;">发布时间：{{getTime(item.createTime)}}\n</text>
>>>>>>> parent of 9c00801 (2.0 老人，管理员，新的ui)
					</view>
				</view>
			</view>
			
			<view style=" padding-top: 30rpx;">
				<view style="margin-left: 30rpx;">申请记录</view>
				<view style="display: flex; flex-wrap: wrap; justify-content:space-between; margin: 0 50rpx;">
					<view @tap="toSubsidy" style="margin-top: 30rpx; width: 180rpx; height: 180rpx; text-align: center; background-color: #00D3C4; box-shadow: #00D3C4 0 2px 6px 0; border-radius: 20rpx;">
						<icon  style="color: #FFFFFF; font-size: 80rpx; margin: 20rpx 0 10rpx; " class="icon-zhufangbutie iconfont" ></icon>
						<view style="color: #FFFFFF; font-size: 28rpx;">补贴申请</view>
					</view>
					<view @tap="toEmigration" style="margin-top: 30rpx; width: 180rpx; height: 180rpx; text-align: center; background-color: #55B9D4; box-shadow: #55B9D4 0 2px 6px 0; border-radius: 20rpx;">
						<icon  style="color: #FFFFFF; font-size: 80rpx; margin: 20rpx 0 10rpx; " class="icon-hukouqianchubenshi iconfont" ></icon>
						<view style="color: #FFFFFF; font-size: 28rpx;">迁出申请</view>
					</view>
					<view style="margin-top: 30rpx; width: 180rpx; height: 180rpx; ">
						
					</view>
				</view>
			</view>
			
		</view>
<<<<<<< HEAD
=======


>>>>>>> parent of 9c00801 (2.0 老人，管理员，新的ui)
	</view>
</template> 

<script>
<<<<<<< HEAD
=======
	import indexModule from "@/components/ui/page/index-module.vue";
>>>>>>> parent of 9c00801 (2.0 老人，管理员，新的ui)
	export default {
		components: { 
		},
		data() {
			return {
<<<<<<< HEAD
				
			}
		},
		computed: { 
		    
		},
		async onShow() {
			
			
		},
		methods:{
			toAll:function(){
				uni.navigateTo({
					url:'./service/odd-age-allowance'
				})
			},
			toEmi:function(){
				uni.navigateTo({
					url:'./emigration/emigration'
				})
			},
			toEmigration:function(){
				uni.navigateTo({
					url:'./emigrations/emigrations'
				})
=======
				current: 0,
				sliderX: 0,
				nickName: '',
				articleList:[],
				slideList:[]
			}
		},
		async onShow() {
			var that = this
			this.nickName = uni.getStorageSync('nickName') || '请先登录';
			if(this.nickName == '请先登录'){
				uni.reLaunch({
				    url: '../login/login'
				});
			}
		
			//获取通知列表
			var articleList = await that.$api.getArticleList();
			this.articleList = articleList.data
			console.log(this.articleList.length)
			
			//加载轮播图
			var slideList = await that.$api.slideshow();  
			console.log(slideList)
			this.slideList = slideList.data
		},
		methods: {
			getTime(temp){
				return this.$utiltg.dateDiff(temp)
>>>>>>> parent of 9c00801 (2.0 老人，管理员，新的ui)
			},
			toSubsidy:function(){
				uni.navigateTo({
					url:'./subsidy/subsidy'
				})
			},
<<<<<<< HEAD
			toLogin:function(){
				uni.navigateTo({
					url:'../login/register'
				})
			},
			toRegistered:function(){
				uni.navigateTo({
					url:'./registered/registered'
				})
=======
			toDetail(text) {
				console.log(text)
				this.$utiltg.navigateTo(`/pages/index/detail?id=${text}`)
			},changePage(e) {
				this.current = e.detail.current;
			},
			changeChoice() {
				var that = this;
				if (that.sliderX == 0) {
					that.sliderX = 100;
				} else {
					that.sliderX = 0;
					that.current = 0

				}
>>>>>>> parent of 9c00801 (2.0 老人，管理员，新的ui)
			},
			tips:function(){
				uni.showModal({
					content:'功能开发中，请期待后续版本'
				})
			}
		}
	
	}
</script>

<style scoped>
	.body{
		width: 750rpx;
		height: 800rpx;
		margin: 0;
		padding: 0;
		background-color: #60CB64;
	}
	.module-list-box{
		width: 750rpx;
		background-color: #FFFFFF;
		border-radius: 30rpx;
		
	}
	.module:checked{
		background-color: #007AFF !important;
	}
</style>
